<template>
  <div class="modal-content">
    <div class="modal-header">
      <div class="header-container">
        <span class="title">{{title}}</span>
        <i @click="onClose" class="close-btn"></i>
      </div>
    </div>
    <div class="modal-body">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ModalContent',
  props: {
    title: {
      type: String,
      default: ''
    }
  },
  methods: {
    onClose () {
      this.$emit('close')
    }
  }
}
</script>

<style scoped lang="less">
  .modal-content {
    width: 472px;
    background-color: #fff;
    margin: 30vh auto;

    .modal-header {
      height: 64px;
      background: #EFF0F1;
      color: #1F2329;
      text-align: center;
      display: flex;
      align-items: center;

      .header-container {
        width: 100%;
        padding: 24px;
      }
    }

    .close-btn {
      cursor: pointer;
      display: inline-block;
      float: right;
      width: 15px;
      height: 15px;
      background: url("/images/icon_close.svg");
    }

    .modal-body {
      padding: 32px 56px;
      box-sizing: border-box;
    }
  }
</style>
